import java.util.Scanner;

public class DoWhile{

  public static void main(String[] args){
    int num1 = 7, num2 = 6, response, count = 0;
    boolean failCondition;
    
    Scanner scanner = new Scanner(System.in);
    
    System.out.printf("What is %d * %d ?\n", num1, num2);
    do{
        
        response = scanner.nextInt();
        count++;
        
        failCondition = (response != num1 * num2) && (count < 3);
        
        if(failCondition)
              System.out.println("Wrong response. Please try again");
        
        
    } while(failCondition);
    
    if(response != num1 * num2)
       System.out.println("\nSorry ! You were not successful\n");
    else
       System.out.println("\nCongratulations !  You got the correct answer\n");
  }
}
